package annotationAndReflection;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @author mubei
 * @date 2021/11/25
 * @description
 */
@AllArgsConstructor
@NoArgsConstructor
@Setter
@Getter
public class Cat {

    public String name = "ah";
    public void hi(){
        System.out.println("喵"+name);
    }

    @Override
    public String toString() {
        return "Cat{" +
                "name='" + name + '\'' +
                '}';
    }
}

@AllArgsConstructor
@NoArgsConstructor
@Setter
@Getter
class Truck extends Cat{
    public int age = 19;

    @Override
    public String toString() {
        return "Truck{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
